from .log import LogConnection, LOG_SETTINGS
from datetime import datetime, timedelta


def export_log_data(start_time=None, end_time=None):
    log_conn = LogConnection(LOG_SETTINGS)
    print("success!")

    # end_time = datetime.now()
    # start_time = end_time - timedelta(minutes=5)
    print("begin export...")
    data = log_conn.export_logs(start_time, end_time)
    data.to_csv("/neurallog/data/log.csv", index=False)
